package com.itheima;

import org.junit.Test;

/**
 * @author hzqstart
 * @create 2022-03-29-16:36
 */
public class Student {
    private String name;
    public  String getName(){
        return name;
    }
    public Student(String name){
        this.name=name;
    }

    public static void main(String[] args) {
        Student s1 = new Student("小张");
        Student s2 = new Student("小李");
        Test.swap(s1,s2);
        System.out.println("s1:"+s1.getName());
        System.out.println("s2:"+s2.getName());
    }
    public static class  Test{
        public static void swap(Student x, Student y){
            Student temp=x;
            x=y;
            y=temp;
            System.out.println("x:"+x.getName());
            System.out.println("y:"+y.getName());
        }
    }
}